#include <iostream>
using namespace std;
const int N=1e6+10;
typedef unsigned long long ULL;
ULL a[N];
ULL b[N];
ULL f[N];
ULL p[N];
string s;
int m;
int P=131; 
int l1,r1,l2,r2;
ULL get_hash(int l,int r)
{
   return f[r]-f[l-1]*p[r-l+1];
}
int main()
{
	cin>>s>>m;
	p[0]=1;
	for(int i=1;i<=s.size();i++)
	{
		f[i]=f[i-1]*P+s[i-1];
		p[i]=p[i-1]*P;
	}
	for(int i=1;i<=m;i++)
	{
		cin>>l1>>r1>>l2>>r2;
		a[i]=get_hash(l1,r1);
		b[i]=get_hash(l2,r2);
		if(a[i]==b[i])cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}
